import os
returnpath = []
def testpath(path):
    subfolders = [f for f in os.listdir(path) if os.path.isdir(os.path.join(path,f))]
    for subfolder in subfolders:
        fullpath = os.path.join(path,subfolder)
        testpath(fullpath)
        flag = 0
        for filename in os.listdir(fullpath):
            if(filename.endswith(".c")):
                print(f"{fullpath}/{filename}")
            elif (filename.endswith(".h")):
                flag = 1
            else:
                pass
        if (flag == 1):
            returnpath.append(fullpath)
    return returnpath

path = testpath('.')
for f in path:
    print(f)
